package user;

import java.io.IOException;

import global.Global;
import home.Home;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONException;
import org.json.JSONObject;

import ajaxmethods.AjaxMethod;

public class SignOut implements AjaxMethod {

	@Override
	public void perform(HttpServletRequest request, HttpServletResponse response) {
		response.setContentType("text/json");
		Global global = new Global(request);
		global.logout();
		try {
			new JSONObject().put("signedout", true).write(response.getWriter());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
